Socket
Socket
Sign inDemoInstall

@types/lodash.get

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/lodash.get

TypeScript definitions for lodash.get


Version published
Weekly downloads
387K
increased by4.54%
Maintainers
1
Weekly downloads
 
Created

What is @types/lodash.get?

@types/lodash.get is a TypeScript type definition package for the lodash.get function, which is part of the Lodash library. Lodash.get is used to safely access deeply nested properties in objects without having to check if each level of the object exists.

What are @types/lodash.get's main functionalities?

Accessing Nested Properties

This feature allows you to access deeply nested properties in an object safely. If the property does not exist, it returns undefined.

const _ = require('lodash.get');
const object = { 'a': [{ 'b': { 'c': 3 } }] };
const value = _.get(object, 'a[0].b.c');
console.log(value); // Output: 3

Default Value

This feature allows you to specify a default value that will be returned if the property does not exist.

const _ = require('lodash.get');
const object = { 'a': [{ 'b': { 'c': 3 } }] };
const value = _.get(object, 'a[0].b.d', 'default');
console.log(value); // Output: 'default'

Other packages similar to @types/lodash.get

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc